<template>
  <div>
   <el-card>
<!--     新增模块-->
     <el-row>
       <el-button type="danger">新增模板</el-button>
     </el-row>
<!--     表单部分-->
     <el-table :data="listData">
       <el-table-column label="模板类型" prop="templateType">
         <template #default="{ row }">
           <span v-if="row.templateType === 1">同城寄</span>
           <span v-if="row.templateType === 2">省内寄</span>
           <span v-if="row.templateType === 3">经济区互寄</span>
           <span v-if="row.templateType === 4">跨省</span>
         </template>
       </el-table-column>
       <el-table-column label="运费类型" prop="templateType">
         <template #default="{ row }">
           <span v-if="row.transportType === 1">普快</span>
           <span v-if="row.transportType === 2">特快</span>
         </template>
       </el-table-column>
       <el-table-column label="关联城市" prop="associatedCityList">
         <template #default="{ row }">
           <span v-if="row.associatedCityList[0] === '1'">全国</span>
           <span v-if="row.associatedCityList[0] === '2'">京津冀</span>
           <span v-if="row.associatedCityList[0] === '3'">江浙沪</span>
           <span v-if="row.associatedCityList[0] === '4'">川渝</span>
           <span v-if="row.associatedCityList[0] === '5'">黑吉辽</span>
         </template>
       </el-table-column>
       <el-table-column label="首重" prop="firstWeight"/>
       <el-table-column label="续重" prop="continuousWeight"/>
       <el-table-column label="轻抛系数" prop="lightThrowingCoefficient"/>
       <el-table-column label="操作">
         <template #default>
           <el-button type="text">编辑</el-button>
           <el-button type="text">删除</el-button>
         </template>
       </el-table-column>
     </el-table>
   </el-card>
  </div>
</template>
<script>
import { transitApi } from '@/api/transit'

export default {
  name: 'freight-manage',
  data () {
    return {
      listData: [{}]
    }
  },
  created () {
    console.log(123)
    this.getList()
  },
  methods: {
    // 获取运费模板列表
    async getList () {
      const res = await transitApi()
      console.log(res)
      this.listData = res.data
    }
  }
}
</script>
